package com.mingsoft.led.comm;

import java.util.ArrayDeque;
import java.util.Queue;

import com.mingsoft.led.Cmd;

public final class CommQueue {
	private Queue<Cmd> commands = new ArrayDeque<Cmd>();

	private static final CommQueue commQueue = new CommQueue();

	public static CommQueue getInstance() {
		return commQueue;
	}

	private CommQueue() {
	}

	public void addCommand(Cmd cm) {
		System.out
				.println("addCommand:\t" + cm.getCmd() + "\t" + cm.getParam());
		synchronized (this) {
			commands.add(cm);
		}
	}

	public Queue<Cmd> getCommands() {
		return commands;
	}

	public void setCommands(Queue<Cmd> commands) {
		this.commands = commands;
	}
}
